package [basepackage].connector;

import org.springframework.stereotype.Service;

import [basepackage].constant.ErrorTams;
import net.wicp.tams.common.connector.beans.CusDynaBean;
import net.wicp.tams.common.connector.executor.IBusiApp;
import net.wicp.tams.common.exception.ExceptAll;
import net.wicp.tams.common.exception.ProjectException;

@Service(value = "test")
public class TestCommond implements IBusiApp {
	@Override
	public CusDynaBean exe(CusDynaBean inputBean, CusDynaBean outBeanOri) throws ProjectException {
		String transactionNo = inputBean.getStrValueByName("transactionNo");
		if ("0".equals(transactionNo)) {
			outBeanOri.setMock();
			return outBeanOri;
		}
		if ("1".equals(transactionNo)) {
			throw new ProjectException(ErrorTams.pwderror);
		}
		if ("2".equals(transactionNo)) {
			throw new ProjectException(ExceptAll.param_error, "必须传入transactionNo");
		}
		outBeanOri.set("retvalue", transactionNo);
		return outBeanOri;
	}
}
